@import '../../../../../../node_modules/ant-design-vue/lib/style/themes/default.less';
@import '../../../../../../node_modules/ant-design-vue/es/button/style/mixin.less';

.button-variant(@color; @background; @border; @background-hover; @border-hover;

  @h-btn-disable-color; @h-btn-disable-bg; @h-btn-disable-border ) {
  .button-color(@color; @background; @border);

  text-shadow: @btn-text-shadow;
  box-shadow: @btn-primary-shadow;

  &:hover,
  &:focus {
    .button-color(@color; @background-hover; @border-hover);
  }

  &:active,
  &.active {
    .button-color(@color; ~`colorPalette('@{background-hover}', 7) `; ~`colorPalette('@{border-hover}', 7) `);
  }

  // .button-disabled();
  .button-disabled(@h-btn-disable-color; @h-btn-disable-bg; @h-btn-disable-border);
}

.set-button-color(@btn-type, @btn-color, @btn-bg, @btn-border-color, @btn-hover-bg: @btn-bg, @btn-hover-border: @btn-border-color,
  @h-btn-disable-color: @btn-disable-color, @h-btn-disable-bg: @btn-disable-bg, @h-btn-disable-border: @btn-disable-border,
  @btn-border-radius: @btn-border-radius-base) {
  .ant-btn-@{btn-type} {
    .button-variant(@btn-color; @btn-bg; @btn-border-color; @btn-hover-bg; @btn-hover-border;
      @h-btn-disable-color; @h-btn-disable-bg; @h-btn-disable-border );
    border-radius: @btn-border-radius;

    .ant-btn-group {
      &:not(:first-child):not(:last-child) {
        border-right-color: @btn-border-color;
        border-left-color: @btn-border-color;

        &:disabled {
          border-color: @btn-default-border;
        }
      }

      &:first-child {
        &:not(:last-child) {
          border-right-color: @btn-border-color;

          &[disabled] {
            border-right-color: @btn-default-border;
          }
        }
      }
    }

    .ant-btn-group &:last-child:not(:first-child),
    .ant-btn-group &+& {
      border-left-color: @btn-border-color;

      &[disabled] {
        border-left-color: @btn-default-border;
      }
    }
  }
}